<?php
require("../config.php");
	$sid = $_REQUEST['sid'];
	$t = $_REQUEST['t'];
	if($sid!=null)
	{
			$btime = time();
			/*$wname = $class_go->C_title($_REQUEST['wname']);
			$wnum = $class_go->C_title($_REQUEST['wnum']);
			$wprice = $class_go->C_title($_REQUEST['wprice']);*/
			$etime = strtotime($t);
			$udb->sqls("update freight_table set sign=1 where freight_id=$sid");
			$wood = $udb->sqls("select freight_id,uid,freight_name,freight_num,freight_price from freight_table where freight_id=$sid");
			$uid = $wood[0]['uid'];
			$wname = $wood[0]['freight_name'];
			$wnum = $wood[0]['freight_num'];
			$wprice = $wood[0]['freight_price'];
			echo "update sale_table set begintime='$btime',endtime='$etime',sign=1 where fid=$sid";
			$sid = $udb->sqls("update sale_table set begintime='$btime',endtime='$etime',sign=1 where fid=$sid");
			//$sid = $udb->sqls("insert into list (sid,uid,wname,wnum,wprice,flag) values ($sid,$uid,'$wname',$wnum,$wprice,0)");
			if($sid != null)
			{
				
				echo "<script language=\"JavaScript\">alert(\"出售商品成功!!\");</script>"; 
				echo "\n<!--Start header -->\n";
				require("../html/head.html");
				echo "\n<!--End header -->\n";
				echo "\n<!--Start Content -->\n";
				require("../html/sell_goods.html");
				echo "\n<!--End Content -->\n";
				echo "\n<!--Start Foot -->\n";
				require("../html/foot.html");
				echo "\n<!--End Foot -->\n";
			}
			else
			{
				echo "<script language=\"JavaScript\">alert(\"出售商品失败!!\");</script>"; 
				echo "\n<!--Start header -->\n";
				require("../html/head.html");
				echo "\n<!--End header -->\n";
				echo "\n<!--Start Content -->\n";
				require("../html/sell_goods.html");
				echo "\n<!--End Content -->\n";
				echo "\n<!--Start Foot -->\n";
				require("../html/foot.html");
				echo "\n<!--End Foot -->\n";
			}
			
	}

?>